package cn.meetingroom.service;

import cn.meetingroom.dao.ItemDao;
import cn.meetingroom.dao.RoomDao;
import cn.meetingroom.model.Room;
import cn.meetingroom.model.RoomState;

import java.util.List;

public class RoomService {
    private RoomDao roomDao = new RoomDao();
    private ItemDao itemDao = new ItemDao();
    public List<Room> getRoomList(){
        return roomDao.getAllRoom();
    }

    public List<RoomState> getRoomState(){
        return roomDao.getRoomStateList();
    }

    public List getUntreatedRoom(){
        return itemDao.getUntreated();
    }

    public List<RoomState> getRoomStateByUser(long id){
        return roomDao.getRoomStateListByUser(id);
    }

    public Room getRoomById(int id){
        return roomDao.find("id",id);
    }

    public boolean addRoom(Room room){
        return roomDao.addRoom(room);
    }

    public List<Room> fuzzS(String value){
        return roomDao.fuzzySearch(value);
    }
}
